package cn.wolfcode.tieba.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 发帖表
 */
@Getter
@Setter
@ToString
@TableName("posted")
public class Posted {

    @TableId(type = IdType.AUTO)
    private Long id;

    //标题
    private String title;

    /** 内容*/
    private String content;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;  //创建时间

    //关联回复
    @TableField(exist = false)
    private List<Reply> replys = new ArrayList<>();

}